<script lang="ts">
import { defineComponent } from "vue";

export default defineComponent({
  props: {
    modelValue: { type: Boolean, required: true },
    size: { type: String, default: "36rpx" },
    color: { type: String, default: "#fa6731" },
    disabled: Boolean,
  },
  emits: {
    "update:modelValue": (value: boolean) => typeof value === "boolean",
  },
  setup(props, ctx) {
    const checkClick = () => {
      ctx.emit("update:modelValue", !props.modelValue);
    };
    return { checkClick };
  },
});
</script>

<template>
  <view class="form-checkbox" @click="checkClick">
    <view class="form-checkbox-wrapper" :style="{ width: size, height: size }">
      <icon v-if="modelValue" type="success" :size="size" :color="color" />
      <icon v-else type="circle" :size="size" />
    </view>
  </view>
</template>

<style lang="scss">
.form-checkbox {
  .form-checkbox-wrapper {
    display: flex;
    justify-content: center;
    // align-items: center;
    // overflow: hidden;
  }
}
</style>